
//获取应用实例
Page({
  data: {
    classesPic: []
  },
  onLoad: function (options) {
    // 生命周期函数--监听页面加载
    var that = this;
    //货架分类
    wx.request({
      url: 'https://api.leancloud.cn/1.1/classes/Classify/587ed398128fe100570ad98d',
      data: {},
      method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
      header: {
        // 设置请求的 header，content-type 默认为 'application/json'
        'X-LC-Id': 'NifgaRbeW9zYQU8pP4zxPC9S-gzGzoHsz',
        'X-LC-Key': 'Ygv6uGw1TQmpB2Kk18m5TgvX'
      },
      success: function (res) {
        // success
        console.log(res)
        var classesPic = res.data.data;
        that.setData({
          classesPic: classesPic
        })
      }
    });
  },
  onShareAppMessage: function () {
    // 用户点击右上角分享
    return {
      title: 'title', // 分享标题
      desc: 'desc', // 分享描述
      path: 'path' // 分享路径
    }
  }
})